package com.gaofans.vertx.boot.dbutils.mapper.columns;

import com.gaofans.vertx.boot.dbutils.mapper.ColumnMapper;
import io.vertx.core.json.JsonArray;
import io.vertx.sqlclient.Row;

public class JsonArrayColumnColumnMapper implements ColumnMapper {
    @Override
    public boolean match(Class<?> propType) {
        return JsonArray.class.equals(propType);
    }

    @Override
    public Object apply(Row r, String columnName) {
        return r.get(JsonArray.class,r.getColumnIndex(columnName));
    }
}
